package com.sqx.modules.orders.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.common.utils.Result;
import com.sqx.modules.orders.entity.Orders;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;


public interface OrdersService extends IService<Orders> {

    Result insertOrders(Orders orders);

    Result insertOrdersFixedStroke(Orders orders);

    Result payOrders(Long ordersId);

    void sendOrdersMessage(Orders orders);

    Result selectOrdersDetails(Long ordersId,Long driverUserId,Long driverRouteId);

    Result selectOrdersList(Integer page,Integer limit,Integer appointmentType,Integer appointmentNum,Integer status,String shipProvince,
                            String shipCity,String shipDistrict,String shipAddress,String deliveryProvince,String deliveryCity,
                            String deliveryDistrict,String deliveryAddress,String userName,String phone,String shipUserName,String shipUserPhone,
                            String driverName,String driverPhone,Integer sort,Long driverRouteId,String longitude,String latitude,Long driverId,
                            String ordersNo,Integer orderType,Long driverUserId,Long driverRouteIds,Integer isFixedStroke);

    Result takingOrders(Long ordersId,Long userId,Integer admin,Long driverRouteId);

    Result proceedOrders(Long ordersId,String code);

    Result completeOrders(Long ordersId);

    Result cancelOrders(Long ordersId);

    Result refundOrders(Long ordersId);

    Map<String, Integer> getOrderSubscript(Long userId);

    Integer selectTakeOrdersCount(Long userId,String date);

    Integer selectMyOrdersCount(Long userId,String date);

    BigDecimal selectOrdersPingMoney(Integer flag, String time);

    Result findIncome(Long userId);

    Result selectOrderByStatus(String date, Integer flag);

    Result incomeStatistics(String date, Integer dateType);

    Result selectTeamUserList(Integer page, Integer limit, String invitationCode,Integer type,Long userId);

    Double selectOrdersMoneyCountByUserId(Long userId,Integer type);

    Integer selectUserCountByInvitationCode(String invitationCode,Integer type);

    Result platformMoney(String dateType, String date);

    Integer selectOrdersCountStatisticsByYear(Integer flag,String time,Integer status);

    IPage<Orders> selectOrdersListByInvoice(Integer page,Integer limit,Long userId,String ordersNo,String startTime,String endTime);

}
